Release 10.1A: OpenEdge Development:
Progress 4GL Reference
ENTRY function
Returns a character string entry from a list based on an integer position.
Syntax
elementAn integer value that corresponds to the position of a character string in a list of values. If the value of
elementdoes not correspond to an entry in the list, Progress raises the ERROR condition. If the value ofelementis the Unknown value (?), ENTRY returns the Unknown value (?). Ifelementis less than or equal to 0, or is larger than the number of elements inlist, ENTRY returns an error.listA list of character strings separated with a character delimiter. The
listcan be a variable of type CHARACTER or LONGCHAR. If the value oflistis the Unknown value (?), ENTRY returns the Unknown value (?).characterA delimiter you define for the list. The default is a comma. This allows the ENTRY function to operate on non-comma-separated lists. If you use an alphabetic character, this delimiter is case sensitive.
ExamplesThis procedure returns the day of the week that corresponds to a date the user enters. The WEEKDAY function evaluates the date and returns, as an integer, the day of the week for that date. The ENTRY function uses that integer to indicate a position in a list of the days of the week.
This is an example of a list separated by dashes instead of commas. The result is “helvetica”.
The next procedure looks up UNIX login IDs in a small password array and returns the name of the user.
Note
The ENTRY function is double-byte enabled. It can return an entry that contains double-byte characters from a specified list and the
characterdelimiter can be a double-byte character.See also
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |